---
title: Configure MockSAML as an Identity Provider in ZITADEL
sidebar_label: MockSAML
id: mocksaml
---

import GeneralConfigDescription from './_general_config_description.mdx';
import Intro from './_intro.mdx';
import CustomLoginPolicy from './_custom_login_policy.mdx';
import IDPsOverview from './_idps_overview.mdx';
import Activate from './_activate.mdx';
import TestSetup from './_test_setup.mdx';
import PrefillAction from './_prefill_action.mdx';

<Intro provider="MockSAML"/>

:::warning
MockSAML is not intended for any production environment, only for test purposes
:::

## MockSAML

### Download metadata

You can either download the metadata under [https://mocksaml.com/api/saml/metadata?download=true](https://mocksaml.com/api/saml/metadata?download=true) or skip this step and
fill in the URL when creating the SAML Provider in ZITADEL.

## ZITADEL configuration

### Go to the IdP providers overview

<IDPsOverview templates="SAML"/>

### Create a new SAML ServiceProvider

The SAML provider template has everything you need preconfigured.
Add the metadata.xml or the URL to the metadata which are accessible by you ZITADEL instance.
All the necessary configuration is contained in the metadata which has to be exchanged by the ServiceProvider and the IdentityProvider.

<GeneralConfigDescription provider_account="SAML account" />

![SAML Provider](/img/guides/zitadel_saml_create_provider.png)

### Download metadata

Normally, you would need to download the ServiceProvider metadata from ZITADEL to upload to the IdentityProvider.
They are available under `https://${CUSTOMDOMAIN}/idps/\{ID of the provider in ZITADEL}/saml/metadata`, but this step can be skipped due to the fact that MockSAML is only for testing purposes.

### Activate IdP

<Activate/>

![Activate the SAML Provider](/img/guides/zitadel_activate_saml.png)

### Ensure your Login Policy allows External IDPs

<CustomLoginPolicy/>

## Test the setup

<TestSetup loginscreen="your SAML login"/>

![SAML Button](/img/guides/zitadel_login_saml.png)

![SAML Login](/img/guides/mocksaml_login.png)

## Optional: Add ZITADEL action to autofill userdata

<PrefillAction fields="firstname, lastname, email, display name and username" provider="mockSaml"/>

```js reference
https://github.com/zitadel/actions/blob/main/examples/post_auth_saml.js
```